package com.yeshine.opendata.service.impl;

import com.yeshine.opendata.core.ServiceBase;
import com.yeshine.opendata.dao.IFavorites_listDao;
import com.yeshine.opendata.entity.Favorites_list;
import com.yeshine.opendata.service.IFavorites_listService;
import com.yeshine.opendata.utils.PageResult;
import com.yeshine.opendata.utils.Result;
import com.yeshine.opendata.utils.UploadConstantPath;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import javax.servlet.http.HttpServletRequest;

/**
 * Created by taohj on 2014/7/15.
 */
@Service
public class Favorites_listServiceImpl extends ServiceBase<Favorites_list> implements IFavorites_listService {


    private String PATH = UploadConstantPath.GROUP_HEADIMAGE_PATH;



    private IFavorites_listDao dao;

    @Autowired
    public void setDao(IFavorites_listDao dao) {
        this.dao = dao;
    }


    @Override
    public Result<Favorites_list> create(Favorites_list favorites_list) {
        return null;
    }
    @Override
    public Result<Favorites_list> modify(Favorites_list favorites_list) {

        return null;
    }


    @Override
    public Result<Favorites_list> remove(Favorites_list group) {
        return new Result<Favorites_list>(dao.delete(group) > 0);
    }





    @Override
    public Result<Favorites_list> getById(Integer id) {
        return new Result<Favorites_list>(dao.selectById(id));
    }

    @Override
    public Result<Favorites_list> getList(Favorites_list favorites_list) {
        return new Result<Favorites_list>(dao.selectList(favorites_list));
    }

    @Override
    public Result<Favorites_list> getByPage(PageResult<Favorites_list> pageResult) {
        pageResult.setRows(dao.selectbyPage(pageResult));
        return new Result<Favorites_list>(pageResult);
    }


}
